package com.cloud.service;

import com.alibaba.fastjson.JSONObject;
import com.cloud.entity.ResultEntity;
import com.cloud.entity.ResultPageEntity;
import com.cloud.entity.UploadFileEntity;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @author: cansong
 * @date: 2020/11/26 16:06
 * @description: 上传文件服务
 */
public interface UploadFileService {

	ResultEntity uploadFile(MultipartFile multipartFile) throws IOException;

	ResultEntity saveAndConvert(MultipartFile multipartFile, UploadFileEntity entity) throws IOException;

	UploadFileEntity multipartFileToFileEntity(MultipartFile multipartFile) throws IOException;
	/**
	 * 新增上传文件
	 */
	ResultEntity addUploadFile(UploadFileEntity uploadFileEntity);

	/**
	 * 新增多文件上传
	 * @param uploadFileEntityList
	 * @return
	 */
	ResultEntity addUploadFiles(List<UploadFileEntity> uploadFileEntityList);

	/**
	 * 上传文件列表
	 */
	ResultPageEntity listUploadFile(JSONObject jsonObject);

	/**
	 * 条件查询
	 * @param jsonObject
	 * @return
	 */
	ResultEntity getUploadFileByCondition(JSONObject jsonObject);

	/**
	 * 删除上传文件
	 */
	ResultEntity removeUploadFile(UploadFileEntity uploadFileEntity);

	/**
	 * 上传文件通知
	 */
	ResultEntity uploadNotify(List<UploadFileEntity> uploadFileEntityList);
}
